import Vue from "vue";
import VueRouter from "vue-router";

Vue.use(VueRouter);

import { ErrorRoutes } from "@/views/ErrorPage/route";
import { MainRoute } from "@/views/Main/route";
import { LoginsRoute } from "@/views/Logins/route";

const routes = [
  {
    path: "/",
    redirect: { name: "guide" },
  },
  ...ErrorRoutes,
  ...MainRoute,
  ...LoginsRoute,
  {
    path: "/guide",
    name: "guide",
    component: () => import("@/views/Guide/Guide.vue"), //路由懒加载
  },
  {
    path: "*",
    redirect: "/404",
  },
];

const router = new VueRouter({
  routes,
});

export default router;
